package com.hectopascal.goalance.exception;

import com.hectopascal.goalance.pojo.dto.ResponseMessage;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandlerAdvice {

    @ExceptionHandler({Exception.class})
    public ResponseMessage handlerException(Exception e){
        return new ResponseMessage<>(500,e.getMessage(),null);
    }//什么异常的统一处理
}
